import sys
from crawler import Crawler


if __name__ == "__main__":
    # user_name = sys.argv[1]
    # password = sys.argv[2]
    # catalog_name = sys.argv[3]
    # topic = sys.argv[4]
    # page_year = "2020"
    # save_file_name = "{}-{}.txt".format(topic, page_year)

    crawler = Crawler(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], "2019")

    from_page = 5
    if len(sys.argv) > 5:
        from_page = sys.argv[5]
    crawler.init_driver()
    crawler.handle_paper(from_page)
